<?php
if($_SESSION['jadwalsaya']!=1){
	echo "Akses tidak diizinkan";
	exit();
}
?>
<div class="title">
	<h5>Data Jadwal Saya</h5>
</div>
<div class="table">										
	<table>
		<thead>
			<tr>
				<th class="action">No.</th>
				<th class="left">Tanggal Kunjungan</th>
				<th class="left">Customer</th>								
				<th class="left">Jatuh Tempo</th>								
				<th class="left">Alamat</th>								
				<th class="left">Telpon</th>								
			</tr>
		</thead>
		<tbody>
			<?php
			$date = date('Y-m-d');
			$sqlKode1 = mysql_query("SELECT * FROM tb_schedule a LEFT JOIN tb_customer b ON a.id_customer=b.id_customer WHERE tgl_jual >= '$date' AND a.id_sales = '$idsales' ORDER BY tgl_jual ASC");
			while($dataKode = mysql_fetch_array($sqlKode1)){
			$tgl = substr($dataKode['tgl_jual'],0,10);
			
			?>
			<tr>
				<td>a</td>
				<td><?php echo $dataKode['tgl_jual'];?></td>
				<td><?php echo $dataKode['nama'];?></td>
				<td><?php echo difference_date($date,$tgl);?> Hari</td>
				<td><?php echo $dataKode['alamat'];?></td>
				<td><?php echo $dataKode['telp'];?></td>				
			</tr>
			<?php } ?>
		</tbody>
	</table>
</div>